<%--
  User: Suk-Lees
  Date: 2022/5/1
  Time: 17:34
  Site: https://www.whatsblog.site
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>注册页面</title>
</head>
<body>
<h1>注册页面</h1>
<form action="/user/register" method="post">
    <table>
        <tr>
            <td>用户名：</td>
            <td><input type="text" name="username"/></td>
        </tr>
        <tr>
            <td>密码：</td>
            <td><input type="password" name="password"/></td>
        </tr>
    </table>
    <input type="submit" value="注册"/>
</form>
<script>
    var form = document.getElementsByTagName("form")[0];
    form.onsubmit = function () {
        if (form.username.value.length < 3) {
            alert("用户名长度不能小于3");
            return false;
        }
        if (form.password.value.length < 6) {
            alert("密码长度不能小于6");
            return false;
        }
    }
</script>
</body>
</html>
